import React, { Component } from 'react';
import { BrowserRouter as Router, Route } from 'react-router-dom'
import { Provider } from 'react-redux'
import { Globalstyle } from './style'
import { Createstyle } from './static/iconfont/iconfont'

//将store 引到所有组件上组件,这样所有的组件都可以用store 中的数据了
import store from './store'

//引入的组件
import Header from './common/header'
import Home from './page/home'
import Detial from './page/detail'
class App extends Component {
  render() {
    return (
      <div>
        <Globalstyle />
        <Createstyle />
        <Provider store={store}>
          <Header />
          <Router>
            <div>
              <Route path='/' exact component={Home}></Route>
              <Route path='/detail/:id' component={Detial}></Route>
            </div>
          </Router>
        </Provider>
      </div>
    );
  }
}

export default App;
